package com.enmonster.mapper;

import com.enmonster.model.TestUser;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author wuxi
 * @create 2019/4/8 下午2:41
 */
public interface TestUserMapper {


    @Select("select * from test_user where age=#{age} and user_name=#{userName}")
    @Results({
            @Result(id=true,column="id",property="id"),
            @Result(column="user_name",property="userName"),
            @Result(column="age",property="age"),
    })
    List<TestUser> getAll(@Param("userName") String accountName,@Param("age") Integer age);

    @Select("select * from test_user where user_name=#{userName}")
    TestUser getAccountByUserName(@Param("userName") String accountName);

    @Insert("insert into test_user (user_name,age) values (#{userName},#{age})")
    long insertAccount(TestUser account);

}
